SET STATISTICS IO ON;

DECLARE @Table TABLE (State CHAR(2), CustomerID INT,  ZMoney Money)

INSERT @Table (State, CustomerID, Zmoney) VALUES
    ('ID',1,1.00),('ID',1,2.00),('ID',2,3.00),('CA',3,4.00),('CA',3,5.00)
    
--SELECT * FROM @Table
    
    
SELECT  State, CustomerID, SUM(ZMoney) AS Total
FROM	   @Table
GROUP   BY GROUPING SETS ((State,CustomerID),())



SELECT  State, CustomerID, SUM(ZMoney) AS Total 
FROM	   @Table
GROUP   BY State, CustomerID
UNION ALL
SELECT  NULL, NULL, SUM(ZMoney) AS Total
FROM	   @Table





--SELECT  State, CustomerID, SUM(ZMoney) AS Total 
--FROM	   @Table
--GROUP   BY State, CustomerID WITH ROLLUP